﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Spider
{
    public class Attribute : ICloneable //继承了ICloneable
    {
        private string m_name;
        private string m_value;
        private char m_delim; //分隔符

        public Attribute(string name, string value, char delim)
        {
            m_name = name;
            m_value = value;
            m_delim = delim;
        }
        public Attribute() //默认构造函数
            : this("", "", (char)0)
        { }
        public Attribute(string name, string value) //有两个值的构造函数
            : this(name, value, (char)0)
        { }
        public char Delim
        {
            get { return m_delim; }
            set { m_delim = value; }
        }
        public string Name
        {
            get { return m_name; }
            set { m_name = value; }
        }
        public string Value
        {
            get { return m_value; }
            set { m_value = value; }
        }
        public virtual object Clone() //Clone的虚方法
        {
            return new Attribute(m_name, m_value, m_delim);
        }
    }
}
